#include<stdio.h>
#include<string.h>
char mars1[13][5]={"jan","feb","mar","apr","may","jun","jly","aug","sep","oct","nov","dec"};
char mars2[12]={"tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mer","jou"};
void zhuan12(a[])
{
	int i,num=0;
	if(num!=0)
	for(i=0;i<strlen(a);i++)
		num=num*10+a[i]-'0';
	while(num!=0)
	{
		i=x/13;
		j%=13;
		j=i;
	}
}

int zhuan10(x[])
{
	
}

int main()
{
	int n,i;
	char a[100],b[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		gets(a);
		if(a[0]>='0'&&a[0]<='9')
		{
			zhuan12(a);
		}
		else
			zhuan(a[0]);
	}
}
